package com.jhs.kjs.dto;

import java.util.Date;

import org.springframework.web.multipart.MultipartFile;

import com.jhs.kjs.dto.util.abstractDTO;

public class AdminPointDTO extends abstractDTO {

	private final int unit = 10;
	private int custom_unit = -1;

	private int start = 0;
	private int end = 0;
	private int nowSeq = 0;
	private int page = 1;
	private int totalPage = 0;
	private int seq = 0;

	private Long pointIndex;
	private String userId;
	private Long textID;
	private Long point;
	private Date pointRegiTime;
	
	public int getStart() {
		if (getPage() > 0 && start == 0) {
			return 1 + getUnit() * (getPage() - 1);
		}
		return start;
	}

	public void setStart(int start) {
		this.start = start;
	}

	public int getEnd() {
		if (getPage() > 0 && end == 0) {
			return getUnit() * getPage();
		}
		return end;
	}

	public void setEnd(int end) {
		this.end = end;
	}

	public int getNowSeq() {
		// ss;
		return nowSeq;
	}

	public void setNowSeq(int nowSeq) {
		this.nowSeq = nowSeq;
		int i = 0;

		for (; getUnit() * i < nowSeq; i++) {
			page = i + 1;
		}
	}

	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public int getTotalPage() {
		return totalPage;
	}

	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}

	public int getSeq() {
		return seq;
	}

	public void setSeq(int seq) {
		this.seq = seq;
	}

	public int getCustom_unit() {
		return custom_unit;
	}

	public void setCustom_unit(int custom_unit) {
		this.custom_unit = custom_unit;
	}

	private int getUnit() {
		if (custom_unit > 0) {
			return custom_unit;
		}
		return unit;
	}


	public Long getPointIndex() {
		return pointIndex;
	}

	public void setPointIndex(Long pointIndex) {
		this.pointIndex = pointIndex;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public Long getPoint() {
		return point;
	}

	public void setPoint(Long point) {
		this.point = point;
	}

	public Date getPointRegiTime() {
		return pointRegiTime;
	}

	public void setPointRegiTime(Date pointRegiTime) {
		this.pointRegiTime = pointRegiTime;
	}

	public Long getTextID() {
		return textID;
	}

	public void setTextID(Long textID) {
		this.textID = textID;
	}

}
